/*
 * @Author: wo4fisher wuhuiting99@163.com
 * @Date: 2022-07-29 18:32:24
 * @LastEditors: wo4fisher wuhuiting99@163.com
 * @LastEditTime: 2022-07-29 19:03:16
 * @FilePath: \gy_msp430_master\bsp\flash.h
 * @Description:
 *
 * Copyright (c) 2022 by wo4fisher wuhuiting99@163.com, All Rights Reserved.
 */

#ifndef APP_FLASH_H_
#define APP_FLASH_H_

#include <msp430.h>
#include "define.h"
#include "stdio.h"

#define SEGA_ADDR 0x1080
#define SEGB_ADDR 0x1000

void erase_flash_seg(uint16_t addr);

void write_seg(uint8_t val,uint16_t addr);
void write_chars_seg(uint8_t *val, uint16_t addr, uint8_t cnt);

uint8_t read_seg(uint16_t addr);


void write_char_params(uint8_t *val,uint16_t addr,uint8_t cnt);
void read_char_params(uint8_t *buf,uint16_t addr,uint8_t cnt);
void write_int_params(uint16_t *val,uint16_t addr,uint8_t cnt);
void read_int_params(uint16_t *buf,uint16_t addr,uint8_t cnt);

#endif /* APP_FLASH_H_ */
/**********  end of file *******/
